package com.aimee.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class Dbutil {
/*	static String url="jdbc:mysql://localhost:3306/exam?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC";
	  static String name="root";
	  static String pass="123456";
	  static String classname="com.mysql.cj.jdbc.Driver";*/
static String url = "jdbc:mysql://47.112.125.32:3306/exam?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true";
	static String name = "root";
	static String pass = "Zx234Exam.";
	static String classname = "com.mysql.cj.jdbc.Driver";

	  //得到连接
		public static Connection getConn() {
			Connection conn=null;
			try {
				Class.forName(classname);
				conn=DriverManager.getConnection(url,name,pass);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return conn;
			
		}

	public static void main(String[] args) {
		Dbutil db=new Dbutil();
		System.out.println(db);
	}
}
